package org.demo.patten.chain_of_responsibility;

/**
 * @author zhuj
 * @date 2025/3/29
 * @apiNote
 */
public class ChainTest {
    public static void main(String[] args) {
        Approver supervisor = new Supervisor();
        Approver manager = new Manager();
        Approver director = new Director();
        supervisor.setNext(manager);
        manager.setNext(director);
        supervisor.handleRequest(1);  // 主管审批
        supervisor.handleRequest(4);  // 经理审批
        supervisor.handleRequest(7);  // 总经理审批
        supervisor.handleRequest(15); // 拒绝
    }
}
